package com.demo.jetpack

import android.content.Context
import android.view.View
import android.widget.Toast
import androidx.navigation.NavController

class AUserAction(val context: Context,
                  val viewModel: SharedViewModel,
                  val navController: NavController) {

    val buttonClicked = View.OnClickListener {
        Toast.makeText(context, "clicked!!!", Toast.LENGTH_SHORT).show()
        navController.navigate(R.id.action_a_2_b, AFragmentDirections.actionA2B(
            viewModel.user.value!!
        ).arguments)
        // navController.popBackStack(R.id.a_fragment, false)
    }

    fun onButtonClicked(view: View) {
        Toast.makeText(context, "clicked!!!", Toast.LENGTH_SHORT).show()
    }

}